package com.wuyan.web.form.service.api;

import com.wuyan.web.base.helper.rep.RepBody;
import com.wuyan.web.form.entity.PubMsg;
import com.wuyan.web.form.form.PubMsgForm;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 消息
 */

@FeignClient(url = "${wuyan.web.base-url}/wuyan/api/pub-msg", name = "wuyan-pub-msg-api")
public interface WuyanPubMsgApiService {

    @PostMapping
    RepBody<PubMsg> create(@RequestBody @Validated PubMsgForm form);

    @PostMapping("/plist")
    RepBody<List<PubMsg>> creates(@RequestBody @Validated List<PubMsgForm> forms);

    @PostMapping("/create-dept-notify/{dept}")
    RepBody<List<PubMsg>> createDeptNotify(@PathVariable("dept") Integer dept,
                                           @RequestParam(value = "dataId", required = false, defaultValue = "0") String dataId,
                                           @RequestBody @Validated String content);
}
